export interface LoginType {
  username: string
  password: string
}

interface ResponseType {
  code: number
  msg: string
  data: {
    token: string
  }
}

export const fetchLogin = ({ username, password }: LoginType) => {
  return new Promise<ResponseType>((resolve, reject) => {
    setTimeout(() => {
      resolve({
        code: 0,
        msg: 'success',
        data: {
          token: `${username}_123`,
        },
      })
    }, 3000)
  })
}
